extends Card


func play_on_release(card_view: CardView) -> void:
	var tween := card_view.create_tween()
	Events.card_table_card_switch_select_mode.emit(card_view)
	tween.tween_interval(0.21)
	await tween.finished
	card_view.play_on_release_signal_finish.emit()
	

func select_confirm(node:Node):
	var ctween = node.create_tween()
	if Globals.player_state.cant_draw_card == 0:
		ctween.set_loops(self.draw_card)
		ctween.tween_callback(
			func():Events.card_table_drad_one_card.emit()	
		)
		ctween.tween_interval(CardManager.pre_drad_card(self.draw_card))
		await ctween.finished
	CardManager.avail_point += self.restore_point
	Events.card_table_point_update.emit()
	
	
func get_desc() -> String:
	if desc_lab == "":
		return ""
	var text = (
		desc_lab
		% [
			self.discard_card,
			self.draw_card,
			self.restore_point
		]
	)
	return text


func init_from_csv(introduce):
	super.init_from_csv(introduce)
	self.discard_card = int(introduce[5])
	self.draw_card = int(introduce[6])
	self.restore_point = int(introduce[7])
	self.card_min = 2
	self.card_max = 2
